package com.uton.rfidcontroller.common.utils;

import android.databinding.BindingAdapter;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.uton.rfidcontroller.R;

/**
 * Created by 王家宝 on 2017/9/7.
 * Email:639586819@qq.com
 * Tel:18241150668
 */

public class BindUtils {

    @BindingAdapter("imageUrl")
    public static void loadImage(ImageView image, String imageUrl) {
        Glide.with(image.getContext())
                .load(imageUrl)
                .centerCrop()
                .error(R.mipmap.default_uton)
                .placeholder(R.mipmap.default_uton)
                .crossFade()
                .into(image);
    }

}
